
<style scoped>

</style>

<template>
  <div class="hello">

    <div @click="toemit" class="btnclass">
        a1button
    </div>
    <el-row>
  <el-button>默认按钮</el-button>
  <el-button type="primary">主要按钮</el-button>
  <el-button type="success">成功按钮</el-button>
  <el-button type="info">信息按钮</el-button>
  <el-button type="warning">警告按钮</el-button>
  <el-button type="danger">危险按钮</el-button>
</el-row>
    11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222
    <br>
    <Date-picker type="daterange" :options="options2" placement="bottom-end" placeholder="选择日期" style="width: 200px"></Date-picker>

    <i-form v-ref:form-inline :model="formInline" :rules="ruleInline" inline>
        <Form-item prop="user">
            <i-input type="text" :value.sync="formInline.user" placeholder="Username">
                <Icon type="ios-person-outline" slot="prepend"></Icon>
            </i-input>
        </Form-item>
        <Form-item prop="password">
            <i-input type="password" :value.sync="formInline.password" placeholder="Password">
                <Icon type="ios-locked-outline" slot="prepend"></Icon>
            </i-input>
        </Form-item>
        <Form-item>
            <i-button type="primary" @click="handleSubmit('formInline')">登录</i-button>
        </Form-item>
    </i-form>
    <div>1</div>
        <div>1</div>
            <div>1</div>

                <div>1</div>

                    <div>1</div>
                        <div>1</div>

                            <div>1</div>
                                <div>1</div>
        <div>1</div>
            <div>1</div>

                <div>1</div>

                    <div>1</div>
                        <div>1</div>

                            <div>1</div>
                                <div>1</div>
        <div>1</div>
            <div>1</div>

                <div>1</div>

                    <div>1</div>
                        <div>1</div>

                            <div>1</div>
                                <div>1</div>
        <div>1</div>
            <div>1</div>

                <div>1</div>

                    <div>1</div>
                        <div>1</div>

                            <div>1</div>
                                <div>1</div>
        <div>2</div>
            <div>2</div>

                <div>2</div>

                    <div>2</div>
                        <div>2</div>

                            <div>2</div>
                                                            <div>1</div>
        <div>2</div>
            <div>2</div>

                <div>2</div>

                    <div>2</div>
                        <div>2</div>

                            <div>2</div>
                                                            <div>1</div>
        <div>2</div>
            <div>2</div>

                <div>2</div>

                    <div>2</div>
                        <div>2</div>

                            <div>2</div>
                                                            <div>1</div>
        <div>2</div>
            <div>2</div>

                <div>2</div>

                    <div>2</div>
                        <div>2</div>

                            <div>2</div>
                                                            <div>1</div>
        <div>2</div>
            <div>2</div>

                <div>2</div>

                    <div>2</div>
                        <div>2</div>

                            <div>2</div>
  </div>

</template>

<script>
export default {
  data () {
      return {
        formInline: {
            user: '',
            password: '',
            dataValue: null
        },
        options2: {
            shortcuts: [
                {
                    text: '最近一周',
                    value () {
                        const end = new Date();
                        const start = new Date();
                        start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
                        return [start, end];
                    }
                },
                {
                    text: '最近一个月',
                    value () {
                        const end = new Date();
                        const start = new Date();
                        start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
                        return [start, end];
                    }
                },
                {
                    text: '最近三个月',
                    value () {
                        const end = new Date();
                        const start = new Date();
                        start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
                        return [start, end];
                    }
                }
            ]
        },
        ruleInline: {
            user: [
                { required: true, message: '请填写用户名', trigger: 'blur' }
            ],
            password: [
                { required: true, message: '请填写密码', trigger: 'blur' },
                { type: 'string', min: 6, message: '密码长度不能小于6位', trigger: 'blur' }
            ]
        }
    }
  },
    methods: {
        toemit(){
            this.$emit("posttt","postmsg")
        },
        handleSubmit(name) {
            debugger
            this.$refs[name].validate((valid) => {
                if (valid) {
                    this.$Message.success('提交成功!');
                } else {
                    this.$Message.error('表单验证失败!');
                }
            })
        },
          handleChange(daterange) {
    this.dataValue = daterange;
  }
    }
}
</script>

